package com.zhongxi.guoyuan.view.update;

import android.view.View;
import android.widget.TextView;

import com.zhongxi.guoyuan.R;
import com.zhongxi.guoyuan.base.BaseActivity;

public class UpdateActivity extends BaseActivity implements View.OnClickListener {

    private TextView tvUpdate;
    private int member;
    public static final int ResultSilver=22;

    @Override
    protected void initView() {
        super.initView();
        setContentView(R.layout.activity_update);
        member = getIntent().getIntExtra("member", 0);
        initTitle();
        tvTitle.setText("升级成为权益会员");
        tvUpdate = (TextView) findViewById(R.id.tvUpdate);
        if (member == 1) {
            tvUpdate.setText("我知道啦");
        } else {
            tvUpdate.setText("立即升级");
        }
    }

    @Override
    protected void initData() {
        super.initData();
    }

    @Override
    protected void initEvent() {
        super.initEvent();
        ivBack.setOnClickListener(this);
        tvUpdate.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.ivBack:
                finish();
                break;
            case R.id.tvUpdate:
                if (member == 1) {
                    setResult(ResultSilver);
                    finish();
                } else {
                    startAct(UpdateSupermanActivity.class);
                }
                break;
        }
    }
}
